/*
 * Title: 反片语(Anaagrams)
 * Author: Yuanshun L
 * Created : 09-otc-2021
 */

#include<iostream>
#include<map>
#include<vector>
#include<algorithm>
#include<cstdio>
using namespace std;

map<string,string> ssm; // 可能消耗很大的存储资源
map<string,int> sim;

// "标准化", 先转化为小写，然后内部进行排序
string standred_string(string &s){
    string temp = s;
    for(int i=0;i<temp.length();i++){
        temp[i] = tolower(temp[i]);
    }
    sort(temp.begin(),temp.end());
    return temp;
}

int main() {
    freopen("data.in","r",stdin);
    freopen("data.out","w",stdout);

    string s,temp;

    // 确定各种映射关系
    while(1){

        cin >> s;
        if(s[0] == '#') break;

        temp = standred_string(s);
        if(!sim.count(temp)) sim[temp] =0;
        sim[temp] += 1;
        ssm[s] = temp;
    }

    vector<string> ana;
    // 确定是否是反片语
    for(map<string,string>::iterator it=ssm.begin();it!=ssm.end();it++){
        if(sim[it->second]==1){
            ana.push_back(it->first);
        }
    }

    // 输出反片语
    int len = ana.size();
    for(int i=0;i<len;i++){
        cout<<ana[i]<<endl;
    }


    return 0;
}